package com.bbm.communitysystem.ai;


import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.ai.ollama.api.OllamaOptions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest
public class mod {


    @Autowired
    private OllamaChatModel ollamaChatModel;

    @Test
    public void testChat() {
        String text = "帮我写一个公告";
        Prompt prompt = new Prompt(text, OllamaOptions.builder()
                .model("deepseek-r1:14b").build());


        ChatResponse call = ollamaChatModel.call(prompt);


        log.info(call.getResult().getOutput().getText());

    }




}
